#coding=utf-8
from google.appengine.ext import db
import logging

class Email(db.Model):
  addr = db.StringProperty(required=True) 
  is_sended = db.BooleanProperty(default=False)
  
  def save(self):
    query = db.GqlQuery('select * from Email where addr = :addr', addr=self.addr)
    n = query.count()
    if n > 0:
      logging.info('%s exists in db...pass.'%self.addr)
    else:
      super(Email, self).put()
